import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StoreRefundApplyVO, StoreRefundApplyForm, StoreRefundApplyQuery } from '@/api/business/storeRefundApply/types';

/**
 * 查询诊所退款申请列表
 * @param query
 * @returns {*}
 */

export const listStoreRefundApply = (query?: StoreRefundApplyQuery): AxiosPromise<StoreRefundApplyVO[]> => {
  return request({
    url: '/business/storeRefundApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询诊所退款申请详细
 * @param id
 */
export const getStoreRefundApply = (id: string | number): AxiosPromise<StoreRefundApplyVO> => {
  return request({
    url: '/business/storeRefundApply/' + id,
    method: 'get'
  });
};

/**
 * 新增诊所退款申请
 * @param data
 */
export const addStoreRefundApply = (data: StoreRefundApplyForm) => {
  return request({
    url: '/business/storeRefundApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改诊所退款申请
 * @param data
 */
export const updateStoreRefundApply = (data: StoreRefundApplyForm) => {
  return request({
    url: '/business/storeRefundApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除诊所退款申请
 * @param id
 */
export const delStoreRefundApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/storeRefundApply/' + id,
    method: 'delete'
  });
};
